home *** CD-ROM | disk | FTP | other *** search
- /*
- ***************************************************************************
- *
- * Datei:
- * RSysSpecialList.c
- *
- * Inhalt:
- *
- * --- Globale Routinen ---
- *
- * void RSysAmigaGuideRefList ( void );
- * void SysAvailFontsList ( void );
- * void SysBrokerList ( void );
- *
- * --- Lokale Routinen ---
- *
- *
- * Bemerkungen:
- * Spezielle Listen, die unter keine der anderen Kategorien fallen.
- *
- * Erstellungsdatum:
- * 07-Jul-93 Rolf Böhme
- *
- * Änderungen:
- * 07-Jul-93 Rolf Böhme Erstellung
- *
- ***************************************************************************
- */
-
- #include "RSys.h"
-
-
- void
- RSysAmigaGuideRefList(void)
- {
- struct List listbuff, *list = &listbuff;
- struct Node *node;
- struct XRef *xrefnode;
- LONG key;
- register int i;
- UBYTE *fpart, filename[16];
- char *XRefTypes[] = {
- "LINK", "FUNC", "COMM", "INCL", "MACR",
- "STRU", "FIEL", "TYPD", "DEFI"
- };
-
- DPOS;
-
- HandleHelp(MN_RSysAmigaGuideRefList);
-
- PrintHeader(AGUIDEXREF, NULL);
-
- EmptyListView();
-
- countentries = 0;
-
- if (AmigaGuideBase = (struct AmigaGuideBase *)OpenLibrary ((STRPTR)"amigaguide.library", 33))
- {
- key = LockAmigaGuideBase(NULL);
-
- if (GetAmigaGuideAttr(AGA_XRefList, NULL, (ULONG *)&list))
- {
- countentries = CountNodes(list);
-
- if (!NoEntries())
- {
- Entries = AllocScrollEntries(countentries);
-
- for(node = list->lh_Head, i = 0; node->ln_Succ && (i < countentries); node = node->ln_Succ, i++)
- {
- xrefnode = (struct XRef *)node;
-
- fpart = FilePart(xrefnode->xr_File);
-
- if(fpart != xrefnode->xr_File) sprintf((char *)filename,"+%-14s.14s",fpart);
- else
- strncpy((char *)filename, (char *)xrefnode->xr_File, 15);
-
- Entries[i].se_obj_id.address = xrefnode;
-
- sprintf(Entries[i].se_Entry, EntryAttr[AGUIDEXREF].ea_dataformat,
- xrefnode,
- xrefnode->xr_Name, XRefTypes[node->ln_Type],
- filename, xrefnode->xr_Line);
- }
-
- CreateEntryList(SORT, 9);
- }
- }
-
- UnlockAmigaGuideBase(key);
-
- CloseLibrary((struct Library *)AmigaGuideBase);
- }
- else ErrorHandle("amigaguide.library", LIBRARY_ERR, OPEN_FAIL, KILL);
-
- PrintStatistics();
-
- return;
- }
-
- void
- SysBrokerList(void)
- {
- struct Node *node,
- *nodes[MAX_BROKER_ENTRIES],
- *StartNode,
- *foundBroker = NULL;
- APTR adr[MAX_BROKER_ENTRIES];
- char name[MAX_BROKER_ENTRIES][22];
- int pri[MAX_BROKER_ENTRIES],
- i,
- cnt;
- extern CxObj *broker;
-
- DPOS;
-
- HandleHelp(MN_SysBrokerList);
-
- PrintHeader(COMMODITIES, NULL);
-
- EmptyListView();
-
- /*
- * Analog zu FindName() oder FindPort() kann auch hier ein
- * Schutzprotokoll nötig sein. Da Commodities auch mit Interrupts
- * arbeiten müssen (InputHandler!), sollte gleich mit
- * Disable()/Enable() hingelangt werden!
- */
- Disable();
-
- foundBroker = (struct Node *)broker;
-
- for (node = foundBroker; node->ln_Pred; node = node->ln_Pred) StartNode = node;
-
- for (node = StartNode, cnt = 0;
- node->ln_Succ && (cnt < MAX_BROKER_ENTRIES);
- node = node->ln_Succ)
- {
- /*
- * Vitale Daten kopieren; der Type ist unbekannt! Damit
- * dennoch die Namen ausgegeben werden können, übergebe ich
- * einfach den Node-Typen.
- */
- savestrcpy(name[cnt], node, 22, (int)node->ln_Type);
- adr[cnt] = node;
- pri[cnt] = node->ln_Pri;
- nodes[cnt++] = node;
- }
-
- Enable();
-
- countentries = cnt;
-
- if(NoEntries()) return;
-
- Entries = AllocScrollEntries(countentries);
-
- for (i = 0; i < cnt; i++)
- {
- Entries[i].se_obj_id.address = adr[i];
-
- sprintf(Entries[i].se_Entry,
- EntryAttr[COMMODITIES].ea_dataformat,
- adr[i], name[i], pri[i]);
-
- AddNodeToList(i, SORT, 9);
- }
-
- PrintStatistics();
-
- return;
- }
-
- /*
- * SysAvailFontsList() listet alle Fonts im Verzeichnis
- * FONTS: auf
- */
- void
- SysAvailFontsList(void)
- {
- char Style[MAXSHOW];
- char *Type[5] =
- {
- "-", "ROM", "DISK", "-", "SCAL"
- };
- struct AvailFontsHeader *afh;
- struct AvailFonts *AF;
- int extrabytes,
- initialsize = sizeof(struct AvailFontsHeader),
- i;
-
- DPOS;
-
- HandleHelp(MN_SysAvailFontsList);
-
- PrintHeader(ALLFONTS, NULL);
-
- EmptyListView();
-
- PrintInfo("Read all Fonts", NO_SPEAK, 0);
-
- do
- {
- afh = (struct AvailFontsHeader *) MyAllocVec(initialsize, MEMF_CLEAR | MEMF_ANY, KILL);
-
- if (afh)
- {
- extrabytes = AvailFonts((STRPTR) afh, initialsize, AFF_DISK);
- if (extrabytes)
- {
- MyFreeVec(afh);
- initialsize += extrabytes;
- }
- }
- } while (extrabytes);
-
- countentries = afh->afh_NumEntries;
-
- if (NoEntries()) return;
-
- Entries = AllocScrollEntries(countentries);
-
- AF = (struct AvailFonts *) & (afh[1]);
-
- for (i = 0; i < countentries; i++)
- {
- strcpy(Style, " ");
-
- if (!(AF[i].af_Attr.ta_Style & FS_NORMAL))
- Style[0] = 'N';
-
- if (AF[i].af_Attr.ta_Style & FSF_UNDERLINED)
- Style[1] = 'U';
-
- if (AF[i].af_Attr.ta_Style & FSF_BOLD)
- Style[2] = 'B';
-
- if (AF[i].af_Attr.ta_Style & FSF_ITALIC)
- Style[3] = 'I';
-
- if (AF[i].af_Attr.ta_Style & FSF_EXTENDED)
- Style[4] = 'E';
-
- if (AF[i].af_Attr.ta_Style & FSF_COLORFONT)
- Style[5] = 'C';
-
- if (AF[i].af_Attr.ta_Style & FSF_TAGGED)
- Style[6] = 'T';
-
- Style[7] = STRINGEND;
-
- Entries[i].se_obj_id.address = &AF[i];
- sprintf(Entries[i].se_Entry, EntryAttr[ALLFONTS].ea_dataformat,
- AF[i].af_Attr.ta_Name,
- Type[AF[i].af_Type],
- AF[i].af_Attr.ta_YSize,
- Style);
-
- AddNodeToList(i, SORT, 0);
- }
-
- MyFreeVec(afh);
-
- PrintStatistics();
-
- return;
- }
-